<template>
	<view class="door-open-page">
		<view class="bg">
			<view class="form-box" v-if="currentStep == 1 || currentStep == 2">
				<view class="step-box">
					<view class="step-item-box">
						<view :class="currentStep == 1 || currentStep == 2  || currentStep == 3 ? 'step-num-active': 'step-num'">1</view>
						<text :class="currentStep == 1 || currentStep == 2 ?'split-text-active' : 'split-text'">实名认证</text>
					</view>
					<view class="step-split">
						<image v-if="currentStep == 1 || currentStep == 2  || currentStep == 3" class="arrow-icon" src="../../static/images/fastServer/right_arrow_active.png"></image>
						<image v-else  class="arrow-icon" src="../../static/images/fastServer/right_arrow_normal.png"></image>
					</view>
					
					<view class="step-item-box">
						<view :class="currentStep == 2 || currentStep == 3 ? 'step-num-active': 'step-num'">2</view>
						<text :class=" currentStep == 2 ?'split-text-active' : 'split-text'">实人认证</text>
					</view>
					<view class="step-split">
						<image v-if="currentStep == 2 || currentStep == 3"class="arrow-icon" src="../../static/images/fastServer/right_arrow_active.png"></image>
						<image v-else  class="arrow-icon" src="../../static/images/fastServer/right_arrow_normal.png"></image>
					</view>
					
					<view class="step-item-box">
						<view :class=" currentStep == 3 ? 'step-num-active': 'step-num'">3</view>
						<text  :class=" currentStep == 4 ?'split-text-active' : 'split-text'">开门入住</text>
					</view>
				</view>
				<view class="step-content">
					<realNameAuth v-if="currentStep == 1"/>
					
				</view>
			</view>
			
			<button class="step-btn" v-if="currentStep == 1 || currentStep == 2" type="primary" @click="handleNext">{{currentStep == 1 ? '下一步' :currentStep == 2 ? '开始人脸识别': null  }}</button>
			<final v-if="currentStep == 3"/>
		
		</view>
	</view>
</template>

<script>
	import realNameAuth from './components/realNameAuth.vue'
	import final from './components/final.vue'
	export default {
		components:{
			realNameAuth,
			final
		},
		data() {
			return {
				currentStep: 3, // 当前步骤
			}
		},
		methods: {
			/**
			 * 点击下一步
			 */
			handleNext( ) {
				this.currentStep += 1
			}
		}
		
	}
	
</script>

<style lang="scss" scoped>
	.door-open-page {
		background: #fff;
		height: 100vh;
		.bg {
			height: 450rpx;
			position: absolute;
			top:0;
			right: 0;
			left: 0;
			z-index: 10;
			width: 100%;
			background: linear-gradient(to bottom, #0156F6, #ffffff);
			.form-box {
				background-color: #fff;
				border-radius: 16rpx;
				margin: 10rpx 30rpx;
				padding-top: 30rpx;
				box-shadow: 0 0 1rpx 5rpx #f3f3f3;
				.step-box {
					display: flex;
					flex-direction: row;
					justify-content: space-around;
					align-items: flex-start;
					padding: 24rpx;
					.step-item-box {
						display: flex;
						flex-direction: column;
						justify-content: center;
						align-items: center;
						.step-num {
							width: 60rpx;
							height: 60rpx;
							text-align: center;
							line-height: 60rpx;
							border-radius: 100rpx;
							background-color: #888888;
							color: #ffffff;
							margin: 0px 10rpx;
							margin-bottom: 20rpx
						}
						.step-num-active {
							width: 60rpx;
							height: 60rpx;
							border-radius: 100rpx;
							color: #ffffff;
							text-align: center;
							line-height: 60rpx;
							background-color: #0156F6;
							margin: 0px 10rpx;
							margin-bottom: 20rpx
						}
						.split-text-active {
							color: #000;
							font-size: 28rpx
						}
						.split-text {
							color: #888;
							font-size: 28rpx
						}
					}
					
					.step-split {
						margin: 0px 10rpx;
						display: flex;
						flex-direction: column;
						justify-content: center;
						align-items: center;
						.arrow-icon {
							width: 60rpx;
							height: 60rpx;
						}
					}
				}
				
			}
		
			.step-btn {
				margin: 30rpx 30rpx 0rpx 30rpx;
				height: 80rpx;
				line-height: 80rpx;
				background-color: #0156F6;
				color: #fff;
				font-size: 28rpx;
			}
		}
		
		
	}
</style>